package com.liuli.service.impl;

import java.util.List;

import javax.annotation.Resource;
import javax.swing.plaf.TreeUI;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;


import com.liuli.dao.BaseDao;
import com.liuli.dao.CategoryDao;
import com.liuli.entity.Category;
import com.liuli.entity.UserInfo;
import com.liuli.service.CategoryService;
import com.liuli.utils.TreeUtils;

@Service("categoryService")
public class CategoryServiceImpl extends BaseServiceImpl<Category> implements CategoryService {
	
	@Autowired
	@Qualifier("categorydao")
	private  CategoryDao categorydao;

	public CategoryDao getCategorydao() {
		return categorydao;
	} 
	
	@Resource(name="categorydao")
	public void setCategorydao(BaseDao<Category> basedao) {
		super.setBasedao(basedao);
		
	}

	@Override
	public List<Category> getCategoryList() {
	     String hql = "from Category";
	     List<Category> list = findByHql(hql,null);
	     return TreeUtils.getChildResoure(list);
	}
	
	
	
	
	

}
